package view;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.util.AttributeSet;
import android.widget.Checkable;
import android.widget.RelativeLayout;

import com.example.wangjin.menu.MainActivity;
import com.example.wangjin.menu.R;

/**
 * Created by wangjin on 15/5/27.
 */
public class itemView extends RelativeLayout implements Checkable{

    private boolean mChecked;

    public itemView(Context context,AttributeSet attrs){
        super(context,attrs);
    }

    @Override
    public void setChecked(boolean checked) {
        mChecked = checked;
        setBackgroundColor(checked?Color.parseColor("#00CCFF"):Color.WHITE);
    }

    @Override
    public boolean isChecked() {
        return mChecked;
    }

    @Override
    public void toggle() {
        setChecked(!mChecked);
    }
}